package com.acme.bankapp.domain.bank;

/**
 * Class for saving accounts without overdraft
 * @author alex
 */
public class SavingAccount extends AbstractAccount {
	/**
	 * @param the balance
	 */
	public SavingAccount(double balance) {
		super(balance);
	}
	
	/**
	 * @param x the money
	 */
	public void withdraw(double x) {
		if (this.balance >= x) {
			this.balance -= x;
		}
	}
	
	/**
	 * @return the maximum amount to withdraw
	 */
	public double maximumAmountToWithdraw() {
		return this.balance;
	}
	
	/**
	 * @return the sting presentation
	 */
	public String toString() {
		return "saving account, balance: " + this.balance;
	}
}
